package com.ssm.security.JWT;


import com.alibaba.fastjson.JSONObject;

import java.io.UnsupportedEncodingException;

/**
 * Created by asd73 on 2017/7/20.
 */
public class JSONResult{
    public static String fillResultString(final Integer status, final String message, final Object result, final String username,final String rid) throws UnsupportedEncodingException {

        JSONObject jsonObject = new JSONObject(){{
            JSONObject data = new JSONObject(){{
                put("user_name",username);
                put("r_id",rid);
                put("access_token",result);

            }};
            put("data", data);
            put("status", status);
            put("msg", message);

        }};
        return jsonObject.toString();
    }
}
